package yhao.demo.service.erp.workflow.apilist.model.flow;


import io.swagger.annotations.ApiModelProperty;
import yhao.demo.service.erp.workflow.apilist.enums.flow.FlowNodeAssignType;
import yhao.demo.service.erp.workflow.apilist.enums.flow.FlowNodeType;
import yhao.infra.common.model.Entity;

import java.util.List;

/**
 * 流程节点
 */
public class FlowNodeModel extends Entity<String> {
    @ApiModelProperty("关联流程定义ID")
    private String processDefinitionId;
    @ApiModelProperty("节点名称")
    private String name;
    @ApiModelProperty("节点类型")
    private FlowNodeType type;
    @ApiModelProperty("指派类型")
    private FlowNodeAssignType assignType;
    @ApiModelProperty("指派实体ID")
    private String assignEntityId;
    @ApiModelProperty("是否有预警")
    private Boolean warn;
    @ApiModelProperty("子流程id")
    private String subProcessId;
    @ApiModelProperty("预警设置")
    private FlowNodeWarnModel nodeWarn;
    @ApiModelProperty("事项设置")
    private List<FlowNodeItemModel> items;

    public String getProcessDefinitionId() {
        return processDefinitionId;
    }

    public void setProcessDefinitionId(String processDefinitionId) {
        this.processDefinitionId = processDefinitionId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public FlowNodeType getType() {
        return type;
    }

    public void setType(FlowNodeType type) {
        this.type = type;
    }

    public FlowNodeAssignType getAssignType() {
        return assignType;
    }

    public void setAssignType(FlowNodeAssignType assignType) {
        this.assignType = assignType;
    }

    public String getAssignEntityId() {
        return assignEntityId;
    }

    public void setAssignEntityId(String assignEntityId) {
        this.assignEntityId = assignEntityId;
    }

    public Boolean getWarn() {
        return warn;
    }

    public void setWarn(Boolean warn) {
        this.warn = warn;
    }


    public FlowNodeWarnModel getNodeWarn() {
        return nodeWarn;
    }

    public void setNodeWarn(FlowNodeWarnModel nodeWarn) {
        this.nodeWarn = nodeWarn;
    }

    public List<FlowNodeItemModel> getItems() {
        return items;
    }

    public void setItems(List<FlowNodeItemModel> items) {
        this.items = items;
    }

    public String getSubProcessId() {
        return subProcessId;
    }

    public void setSubProcessId(String subProcessId) {
        this.subProcessId = subProcessId;
    }

    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof FlowNodeModel)){
            return false;
        }
        return this.getId().equals(((FlowNodeModel)obj).getId());
    }
}
